3.1.43 \(\int \frac {\sec ^4(c+d x)}{a+a \sec (c+d x)} \, dx\) [43]

Optimal. Leaf size=85 \[ \frac {3 \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {2 \tan (c+d x)}{a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))} \]

[Out]

3/2*arctanh(sin(d*x+c))/a/d-2*tan(d*x+c)/a/d+3/2*sec(d*x+c)*tan(d*x+c)/a/d-sec(d*x+c)^2*tan(d*x+c)/d/(a+a*sec(
d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3903, 3872, 3852, 8, 3853, 3855} \begin {gather*} -\frac {2 \tan (c+d x)}{a d}+\frac {3 \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {\tan (c+d x) \sec ^2(c+d x)}{d (a \sec (c+d x)+a)}+\frac {3 \tan (c+d x) \sec (c+d x)}{2 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4/(a + a*Sec[c + d*x]),x]

[Out]

(3*ArcTanh[Sin[c + d*x]])/(2*a*d) - (2*Tan[c + d*x])/(a*d) + (3*Sec[c + d*x]*Tan[c + d*x])/(2*a*d) - (Sec[c +
d*x]^2*Tan[c + d*x])/(d*(a + a*Sec[c + d*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3903

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[d^2*Cot[e +
 f*x]*((d*Csc[e + f*x])^(n - 2)/(f*(a + b*Csc[e + f*x]))), x] - Dist[d^2/(a*b), Int[(d*Csc[e + f*x])^(n - 2)*(
b*(n - 2) - a*(n - 1)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \frac {\sec ^4(c+d x)}{a+a \sec (c+d x)} \, dx &=-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int \sec ^2(c+d x) (2 a-3 a \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}-\frac {2 \int \sec ^2(c+d x) \, dx}{a}+\frac {3 \int \sec ^3(c+d x) \, dx}{a}\\ &=\frac {3 \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}+\frac {3 \int \sec (c+d x) \, dx}{2 a}+\frac {2 \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{a d}\\ &=\frac {3 \tanh ^{-1}(\sin (c+d x))}{2 a d}-\frac {2 \tan (c+d x)}{a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\sec ^2(c+d x) \tan (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(250\) vs. \(2(85)=170\).
time = 1.45, size = 250, normalized size = 2.94 \begin {gather*} \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left (-4 \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \left (-6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {1}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {1}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {4 \sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )\right )}{2 a d (1+\sec (c+d x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4/(a + a*Sec[c + d*x]),x]

[Out]

(Cos[(c + d*x)/2]*Sec[c + d*x]*(-4*Sec[c/2]*Sin[(d*x)/2] + Cos[(c + d*x)/2]*(-6*Log[Cos[(c + d*x)/2] - Sin[(c
+ d*x)/2]] + 6*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + (Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^(-2) - (Cos[(c
 + d*x)/2] + Sin[(c + d*x)/2])^(-2) - (4*Sin[d*x])/((Cos[c/2] - Sin[c/2])*(Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)
/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])))))/(2*a*d*(1 + Sec[c + d*x]))

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 108, normalized size = 1.27

method result size
derivativedivides \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{d a}\) \(108\)
default \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{d a}\) \(108\)
risch \(-\frac {i \left (3 \,{\mathrm e}^{4 i \left (d x +c \right )}+3 \,{\mathrm e}^{3 i \left (d x +c \right )}+5 \,{\mathrm e}^{2 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}+4\right )}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 a d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 a d}\) \(123\)
norman \(\frac {\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {7 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {6 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a d}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a d}\) \(133\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(-tan(1/2*d*x+1/2*c)+1/2/(tan(1/2*d*x+1/2*c)-1)^2+3/2/(tan(1/2*d*x+1/2*c)-1)-3/2*ln(tan(1/2*d*x+1/2*c)-1
)-1/2/(tan(1/2*d*x+1/2*c)+1)^2+3/2/(tan(1/2*d*x+1/2*c)+1)+3/2*ln(tan(1/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 162, normalized size = 1.91 \begin {gather*} -\frac {\frac {2 \, {\left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a - \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} + \frac {2 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(2*(sin(d*x + c)/(cos(d*x + c) + 1) - 3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/(a - 2*a*sin(d*x + c)^2/(cos
(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) - 3*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a + 3*l
og(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a + 2*sin(d*x + c)/(a*(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

Fricas [A]
time = 3.02, size = 112, normalized size = 1.32 \begin {gather*} \frac {3 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (4 \, \cos \left (d x + c\right )^{2} + \cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}{4 \, {\left (a d \cos \left (d x + c\right )^{3} + a d \cos \left (d x + c\right )^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(3*(cos(d*x + c)^3 + cos(d*x + c)^2)*log(sin(d*x + c) + 1) - 3*(cos(d*x + c)^3 + cos(d*x + c)^2)*log(-sin(
d*x + c) + 1) - 2*(4*cos(d*x + c)^2 + cos(d*x + c) - 1)*sin(d*x + c))/(a*d*cos(d*x + c)^3 + a*d*cos(d*x + c)^2
)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sec ^{4}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4/(a+a*sec(d*x+c)),x)

[Out]

Integral(sec(c + d*x)**4/(sec(c + d*x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.44, size = 101, normalized size = 1.19 \begin {gather*} \frac {\frac {3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} + \frac {2 \, {\left (3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

1/2*(3*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - 3*log(abs(tan(1/2*d*x + 1/2*c) - 1))/a - 2*tan(1/2*d*x + 1/2*c)/
a + 2*(3*tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*a))/d

________________________________________________________________________________________

Mupad [B]
time = 0.73, size = 95, normalized size = 1.12 \begin {gather*} \frac {3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^4*(a + a/cos(c + d*x))),x)

[Out]

(3*atanh(tan(c/2 + (d*x)/2)))/(a*d) - tan(c/2 + (d*x)/2)/(a*d) - (tan(c/2 + (d*x)/2) - 3*tan(c/2 + (d*x)/2)^3)
/(d*(a - 2*a*tan(c/2 + (d*x)/2)^2 + a*tan(c/2 + (d*x)/2)^4))

________________________________________________________________________________________